//: C01:StdExcept.cpp
// Derives an exception class from std::runtime_error.
#include <iostream>
#include <pthread.h>
#include <stdexcept>
using namespace std;

class MyError : public runtime_error {
  public:
    MyError(const string &msg = "") : runtime_error(msg) {}
};

int main(void) {
  try {
    throw MyError("my message");
  } catch (MyError &x) {
    cout << x.what() << endl;
  }
}